package org.duiduo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.duiduo.entity.Order;

public interface OrderMapper extends BaseMapper<Order> {

    @Update("update t_order set state = #{state},pay_time = #{payTime},count = #{order.count},total_price = #{order.totalPrice}, pay_price = #{order.payPrice} where order_no = #{order.orderNo}")
    int updateOrderSuccess(@Param("order") Order order, @Param("state") int state, @Param("payTime") String payTime);

    Page<Order> findPage(Page<Order> page, @Param("orderNo") String orderNo, @Param("userId") Integer userId);
}
